Function.prototype._call = function(context = window) {
    if(typeof this != 'function' || this == null) {
        return
    }
    context.fn = this
    let args = [...arguments].slice(1)
    let result = context.fn(...args)
    delete context.fn
    return result
}

let obj = {
    name: '123',
    age: 12,
    myfun:function(a, b) {
        console.log(this.name + '年龄' + this.age + a + b);
    }
}
let obj1 = {
    name: '诚',
    age:18
}

obj.myfun._call(obj1, 'good', 'nice')


Function.prototype.mycall = function(context = window) {
    if(this == null || typeof this != 'function') {
        throw new Error('err')
    }
    context.fn = this
    let arg = [...arguments].slice(1)
    let result = context.fn(...arg)
    delete context.fn
    return result
}
obj.myfun.mycall(obj1, 'good', 'nice','asss')
obj.myfun.call(obj1, 'good', 'nice','asss')

